package com.ayou.binding;

import com.ayou.session.SqlSession;

import java.lang.reflect.Proxy;

/**
 * @description:  mapper代理工厂 负责生产MapperProxy代理
 * @author: ayouman
 * @date: 2024/6/28 17:47
 */
public class MapperProxyFactory {
    public static <T> T getProxy(Class<T> clazz, SqlSession sqlSession) {
        return (T)Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, new MapperProxy(sqlSession, clazz));
    }
}
